@include("admin.layout.head")
<body>
<div class="x-body">
    <div class="fly-panel fly-panel-user" pad20="">
        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title" id="LAY_mine">
                <li class="layui-this" lay-id="info">基本设置</li>
            </ul>
            <div class="layui-tab-content" style="padding: 20px 0;">
                <div class="layui-form layui-form-pane layui-tab-item layui-show">
                    <form method="post" class="layui-form">
                        <div class="layui-form-item">
                            <label for="L_name" class="layui-form-label">商品名</label>
                            <div class="layui-input-inline">
                                <input id="L_name" name="name" required="" lay-verify="" autocomplete="off"
                                       value="" class="layui-input" type="text">
                            </div>
                            <label for="L_price" class="layui-form-label">商品价格</label>
                            <div class="layui-input-inline">
                                <input id="L_price" name="price" required="" lay-verify="" autocomplete="off"
                                       value="" class="layui-input" type="text">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="L_cate" class="layui-form-label">分类</label>
                            <div class="layui-input-inline">
                                <select id="L_cate" name="cate_id" lay-verify="">

                                    <option>请选择一个分类</option>
                                    @foreach($cates as $cate)
                                    <option value="{{$cate->id}}">{{$cate->name}}</option>
                                        @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否上架</label>
                            <div class="layui-input-block">
                                <input name="is_on" value="1" title="上架"  type="radio">
                                <div class="layui-unselect layui-form-radio layui-form-radioed"><i
                                            class="layui-anim layui-icon"></i>
                                    <div>上架</div>
                                </div>
                                <input name="is_on" value="0" title="不上架" checked type="radio">
                                <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i>
                                    <div>不上</div>
                                </div>

                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否新品</label>
                            <div class="layui-input-block">
                                <input name="is_new" value="1" title="新品" checked="" type="radio">
                                <div class="layui-unselect layui-form-radio layui-form-radioed"><i
                                            class="layui-anim layui-icon"></i>
                                    <div>新品</div>
                                </div>
                                <input name="is_new" value="0" title="非新品" type="radio">
                                <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i>
                                    <div>不是</div>
                                </div>

                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">是否精品</label>
                            <div class="layui-input-block">
                                <input name="is_best" value="1" title="精品" checked="" type="radio">
                                <div class="layui-unselect layui-form-radio layui-form-radioed"><i
                                            class="layui-anim layui-icon"></i>
                                    <div>精品</div>
                                </div>
                                <input name="is_best" value="0" title="非精品" type="radio">
                                <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i>
                                    <div>不是</div>
                                </div>

                            </div>
                        </div>

                                <div class="layui-form-item layui-form-text"><label for="L_sign"
                                                                                    class="layui-form-label">简单描述</label>
                                    <div class="layui-input-block"><textarea placeholder="" id="L_sign"
                                                                             name="intro"
                                                                             autocomplete="off" class="layui-textarea"
                                                                             style="height: 80px;"></textarea></div>
                                </div>
                                <div class="layui-form-item">
                                    <button class="layui-btn" key="set-mine" lay-filter="createGoods" lay-submit>确认</button>
                                </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use("form",function () {
        var form = layui.form;
        form.on('submit(createGoods)',function (data) {
            $.ajax({
                url:"/admin/goods",
                type:"post",
                data:data.field,
                dataType:"json",
                success:function (msg) {

                },
                error:function () {

                }
            })
            return false;
        })
    })
</script>
</html>